home *** CD-ROM | disk | FTP | other *** search
- Path: winternet.com!mschwarz
- From: mschwarz@winternet.com (Michael Schwarz)
- Newsgroups: comp.lang.c
- Subject: Re: Watch out! C "gotcha!"
- Date: 15 Feb 1996 22:56:06 GMT
- Organization: StarNet Communications, Inc
- Message-ID: <4g0dm6$97v@blackice.winternet.com>
- References: <4fthhh$7th@blackice.winternet.com>
- NNTP-Posting-Host: parka.winternet.com
- X-Newsreader: TIN [version 1.2 PL2]
-
-
- I just want to leap back into the thread I started and clarify something.
-
- I've been getting a lot of mail from folks telling me this is not a bug.
- I *know* it's not a bug. That's why I called it a "gotcha." We all know
- a bunch of these in C (like the common "=" vs. "==" mistake). It's
- just that in all the years I've been programming in C this particular
- "gotcha" had never occured to me. I've never written a C program with
- a goto in my life (until fiddling around with this little phenomenon)
- and so the (obvious in retrospect) recognition that "default" misspelled
- is a label simply took a while to occur to me.
-
- The reason I posted it was realizing that this error had been sitting
- a piece of production code for an unknown period of time gave me the
- willies (apologies to UK readers!). I suspect that a fairly substantial
- number of working C programmers were and are likewise ignorant of this
- insidious little nascent error. I was likewise bothered by the fact
- that of the five C compilers I routinely use, only ONE (MS Visual C/C++)
- gives a warning for this (to wit, "unreferenced label"), and two of them
- cannot be made to produce a warning for this.
-
- I thought it might be a bit of a civilized act to draw attention to it.
- (BTW, I'm not coming down on any of the folks who have sent me e-mail on
- this -- you've all been helpful and fun. Thank you to all of you!)
-
-
- --
- Michael A. Schwarz Minneapolis, MN
- mschwarz@winternet.com n0zes@n0zes.ampr.org
-
-